package com.yangyu.message.blog;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;

/**
 * @author
 * @version V1.0
 * @Package com.yangyu.message
 * @date 2021/1/10 16:48
 */
@Data
public class SimpleBlogVo implements Comparable<SimpleBlogVo> {

    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    private String title;

    private Integer likeCount;

    private Integer commentNum;

    private String createTime;

    @Override
    public int compareTo(SimpleBlogVo o) {
        return ((Integer)(o.getLikeCount() + o.getCommentNum())).compareTo(this.likeCount + this.commentNum);
    }
}
